﻿<phone:PhoneApplicationPage 
    x:Class="Sinergija13.WP7App.Views.SessionDetailsView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    xmlns:customControls="clr-namespace:Phone.Controls;assembly=Phone.Controls" 
    xmlns:preview="clr-namespace:Phone7.Fx.Preview;assembly=Phone7.Fx.Preview"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" 
    xmlns:b="clr-namespace:Sinergija13.WP7App.Infrastructure.Behaviours"
    xmlns:prismInteractivity="clr-namespace:Microsoft.Practices.Prism.Interactivity;assembly=Microsoft.Practices.Prism.Interactivity"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit" 
    xmlns:delay="clr-namespace:Delay"
    xmlns:prismInteractionRequest="clr-namespace:Microsoft.Practices.Prism.Interactivity.InteractionRequest;assembly=Microsoft.Practices.Prism.Interactivity"
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="800"
    SupportedOrientations="Portrait"  Orientation="Portrait"
    shell:SystemTray.IsVisible="False"
    
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    
    Style="{StaticResource TransitionPageStyle}"
    
    DataContext="{Binding Source={StaticResource ViewModelLocator}, Path=SessionDetailsViewModel}"
    
    toolkit:TiltEffect.IsTiltEnabled="True"
    >

    <i:Interaction.Triggers>
        <i:EventTrigger EventName="Loaded">
            <i:InvokeCommandAction Command="{Binding PageLoadedCommand}"/>
        </i:EventTrigger>
    </i:Interaction.Triggers>

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <!--Pivot Control-->
        <controls:Pivot Title="Sinergija 13 - o predavanju" Foreground="White">
            <controls:Pivot.Background>
                <ImageBrush ImageSource="/Sinergija13.WP7App;component/Resources/Images/Background2.jpg"/>
            </controls:Pivot.Background>
            <!--Pivot item one-->
            <controls:PivotItem Header="opis">
                <StackPanel x:Name="ContentPanel" Margin="12,0,12,0">
                    <Grid Margin="{StaticResource PhoneTouchTargetOverhang}">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="40"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <Rectangle Grid.Column="0" Margin="-6,0,6,0" Fill="{Binding TrackBackgroundColor}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"/>
                        <StackPanel Grid.Column="0" Margin="-6,0,6,0" Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Center">
                            <TextBlock Text="{Binding TrackCode[0]}" TextAlignment="Center" FontFamily="{StaticResource PhoneFontFamilySemiBold}" Foreground="White" FontSize="30" />
                            <TextBlock Text="{Binding TrackCode[1]}" TextAlignment="Center" FontFamily="{StaticResource PhoneFontFamilySemiBold}" Foreground="White" FontSize="30" />
                            <TextBlock Text="{Binding TrackCode[2]}" TextAlignment="Center" FontFamily="{StaticResource PhoneFontFamilySemiBold}" Foreground="White" FontSize="30" />
                        </StackPanel>
                        <Grid Grid.Column="1" VerticalAlignment="Stretch">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="*"/>
                            </Grid.RowDefinitions>
                            <TextBlock Grid.Row="0" Text="{Binding Title}" FontSize="{Binding FontSize}"  FontFamily="{StaticResource PhoneFontFamilySemiBold}" Foreground="White" TextWrapping="Wrap" Margin="12,-10,12,6"/>
                            <!--<TextBlock Text="{Binding MinorInfo}" Style="{StaticResource PhoneTextNormalStyle}" TextWrapping="Wrap" Margin="12,3,0,9"  FontFamily="{StaticResource PhoneFontFamilyNormal}"/>-->
                            <TextBlock Grid.Row="1" Text="{Binding TrackTitle}" Style="{StaticResource PhoneTextNormalStyle}" TextWrapping="Wrap" Margin="12,-5,0,10" Foreground="White" FontFamily="{StaticResource PhoneFontFamilyNormal}"/>
                            <Grid VerticalAlignment="Bottom" Grid.Row="3">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="4.1*"/>
                                    <ColumnDefinition Width="1.25*"/>
                                    <ColumnDefinition Width="1.25*"/>
                                    <ColumnDefinition Width="2.3*"/>
                                </Grid.ColumnDefinitions>
                                <TextBlock Grid.Row="0" Text="{Binding ShortSlotInfo}" Style="{StaticResource PhoneTextNormalStyle}" Foreground="White" TextWrapping="Wrap" FontFamily="{StaticResource PhoneFontFamilyNormal}" HorizontalAlignment="Center"/>
                                <Rectangle Grid.Column="1" Fill="{Binding TrackColor}" Margin="0,0,6,0" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"/>
                                <TextBlock Grid.Column="1" Text="{Binding Level}" Margin="0,-1,6,0" HorizontalAlignment="Center" Foreground="White"/>
                                <Rectangle Grid.Column="2" Fill="{Binding TrackColor}" Margin="0,0,6,0" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"/>
                                <TextBlock Grid.Column="2" Text="{Binding Language}" Margin="0,-1,6,0" HorizontalAlignment="Center" Foreground="White"/>
                                <Rectangle Grid.Column="3" Fill="{Binding TrackColor}" Margin="0,0,6,0" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"/>
                                <TextBlock Grid.Column="3" Text="{Binding Room}" Margin="0,-1,6,0" HorizontalAlignment="Center" Foreground="White"/>
                            </Grid>
                        </Grid>
                    </Grid>
                    <customControls:ScrollableTextBlock  
                            Text="{Binding Description}"           
                            HorizontalAlignment="Left"   
                            VerticalAlignment="Top" 
                            Height="339" 
                            Width="409" 
                            Margin="24,6,0,20"
                            Foreground="White"
                             />
                </StackPanel>
            </controls:PivotItem>

            <!--Pivot item two-->
            <controls:PivotItem Header="predavači">
                <ListBox ItemsSource="{Binding Speakers}" x:Name="sessionSpeakers">
                    <ListBox.ItemTemplate>
                        <DataTemplate>
                            <Grid Margin="{StaticResource PhoneTouchTargetOverhang}">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="*"/>
                                </Grid.ColumnDefinitions>
                                <delay:PlaceImage Grid.Column="0" Width="130" Height="130" PlaceholderSource="/Sinergija13.WP7App;component/Resources/Images/speaker-no-pic.png" Source="{Binding Picture}" VerticalAlignment="Top"/>
                                <StackPanel Grid.Column="1" VerticalAlignment="Top">
                                    <TextBlock Text="{Binding FullName}" Style="{StaticResource PhoneTextLargeStyle}" TextWrapping="Wrap" FontFamily="{StaticResource PhoneFontFamilySemiBold}" Margin="12,-12,12,6" Foreground="White"/>
                                    <TextBlock Text="{Binding Company}" Style="{StaticResource PhoneTextNormalStyle}" TextWrapping="Wrap" FontFamily="{StaticResource PhoneFontFamilySemiBold}" Foreground="White"/>
                                </StackPanel>
                                <i:Interaction.Triggers>
                                    <i:EventTrigger EventName="Tap">
                                        <i:InvokeCommandAction Command="{Binding Path=DataContext.SpeakerSelectedCommand, ElementName=sessionSpeakers}" CommandParameter="{Binding}"/>
                                    </i:EventTrigger>
                                </i:Interaction.Triggers>
                            </Grid>
                        </DataTemplate>
                    </ListBox.ItemTemplate>
                </ListBox>
            </controls:PivotItem>
        </controls:Pivot>
        <!--Sample code showing usage of ApplicationBar-->
        <preview:BindableApplicationBar x:Name="AppBar" BarOpacity="0.7">
            <preview:BindableApplicationBarIconButton 
                Command="{Binding ToggleFavCommand}"
                Text="{Binding AppBarFavText}" 
                IconUri="{Binding AppBarFavIconUri}" />
            <preview:BindableApplicationBarIconButton
                Command="{Binding FloormapViewCommand}"
                Text="{Binding AppBarShowOnMapText}" 
                IconUri="{Binding AppBarShowOnMapIconUri}" />
            <!--{Binding AppBarFavIconUrl}-->
        </preview:BindableApplicationBar>
    </Grid>
</phone:PhoneApplicationPage>
